Optimal. Leaf size=27 \[ \frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4047, 2672,
327, 212} \begin {gather*} \frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 327
Rule 2672
Rule 4047
Rubi steps
\begin {align*} \int (a-a \csc (c+d x)) (A+A \csc (c+d x)) \sin (c+d x) \, dx &=-((a A) \int \cos (c+d x) \cot (c+d x) \, dx)\\ &=\frac {(a A) \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {a A \cos (c+d x)}{d}+\frac {(a A) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {a A \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a A \cos (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 46, normalized size = 1.70 \begin {gather*} -a A \left (\frac {\cos (c+d x)}{d}-\frac {\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 36, normalized size = 1.33
method | result | size |
derivativedivides | \(\frac {-A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-A a \cos \left (d x +c \right )}{d}\) | \(36\) |
default | \(\frac {-A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-A a \cos \left (d x +c \right )}{d}\) | \(36\) |
norman | \(\frac {2 A a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {A a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(52\) |
risch | \(-\frac {A a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {A a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) | \(71\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 40, normalized size = 1.48 \begin {gather*} \frac {A a {\left (\log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, A a \cos \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.94, size = 45, normalized size = 1.67 \begin {gather*} -\frac {2 \, A a \cos \left (d x + c\right ) - A a \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + A a \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - A a \left (\int \sin {\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx + \int \left (- \sin {\left (c + d x \right )}\right )\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 60 vs.
\(2 (27) = 54\).
time = 0.42, size = 60, normalized size = 2.22 \begin {gather*} -\frac {A a \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) - \frac {4 \, A a}{\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.30, size = 40, normalized size = 1.48 \begin {gather*} -\frac {A\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {2\,A\,a}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________